home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 October / enter-2005-10.iso / files / jedit42install.exe / {app} / macros / Interface / Open_Context_Menu.bsh < prev    next >
Encoding:
Text File  |  2004-08-29  |  832 b   |  35 lines

  1. /*
  2. * Open_Context_Menu.bsh - a BeanShell macro script for
  3. * the jEdit text editor - Opens the editor context menu
  4. * just below and to the right of the cursor.
  5. *
  6. * Copyright (C) 2003 Nitsan Vardi
  7. *
  8. * $Id: Open_Context_Menu.bsh,v 1.2 2003/12/22 04:14:54 spestov Exp $
  9. */
  10.  
  11. openContextMenu(){
  12.     // Get the caret's position
  13.     caretOffset = textArea.getCaretPosition();
  14.     caretPos = textArea.offsetToXY(caretOffset);
  15.     // Open the context menu near the caret
  16.     GUIUtilities.showPopupMenu(textArea.getRightClickPopup(),
  17.         textArea,caretPos.x+10,caretPos.y+20);
  18. }
  19.  
  20. openContextMenu();
  21.  
  22. /*
  23.     Macro index data (in DocBook format)
  24.  
  25. <listitem>
  26.     <para><filename>Open_Context_Menu.bsh</filename></para>
  27.     <abstract><para>
  28.         Opens the text area context menu just below and to 
  29.         the right of the caret.
  30.     </para></abstract>
  31. </listitem>
  32.  
  33. */
  34.  
  35.